package housekeeping.controller;

import housekeeping.pojo.UserAccounts;
import housekeeping.service.UserLoginService;
import housekeeping.util.ServerResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version 1.0
 * @Author Du
 * @Date 2025/7/7
 * @注释 用户登录控制器
 */
@RestController
@RequestMapping("/user")
@Tag(name = "用户登录")
public class UserLoginController {

    @Autowired
    private UserLoginService userLoginService;

    @PostMapping("/login")
    @Operation(summary = "用户登录")
    public ServerResult<?> login(@RequestBody UserAccounts user) {
        return userLoginService.login(user);
    }
}
